
package com.feib.soeasy.service;

import java.util.List;
import java.util.Set;

import org.springframework.transaction.annotation.Transactional;

import com.feib.soeasy.model.Group;
import com.feib.soeasy.model.LabelValue;
import com.feib.soeasy.model.MenuItem;
import com.feib.soeasy.model.Role;

/**
 * @title (#)RoleService.java<br>
 * @description 角色邏輯介面<br>
 * @author Anson Tsai<br>
 * @version 1.0.0 2010/11/25
 * @copyright Far Eastern International Bank Copyright (c) 2010<br>
 * @2010/11/14 create by Anson Tsai<br>
 */
@Transactional(readOnly = true)
public interface RoleService
{
    /**
     * 列出所有的角色清單
     * @return
     */
    public List<Role> getAllRole();
    
    /**
     * 角色類別 Key-Value 格式資料
     * @return
     */
    public List<LabelValue> findLabelValueByGroupNo(String groupNo);
    
    /**
     * 透過rolePk取得Role Object
     * @param rolePk
     * @return
     */
    public Role getRole(Long rolePk);
    
    /**
     * 更新角色中的MenuItems 與 Users
     * @param role
     * @param menuItems
     * @return
     */
    @Transactional(readOnly = false)
    public Role saveRole(Role role, Set<MenuItem> menuItems);
    
    /**
     * 
     * @param role
     * @return
     */
    @Transactional(readOnly = false)
    public Role saveRole(Role role);

    /**
     * @param editGroup
     * @return
     */
    public int countRoleByGroupExcludeAdmin(Group group);
}
